﻿using System;
namespace Kis.Xroad.Eu {
    
    
    [System.SerializableAttribute()]
    public class SimpleDateTime : global::Xtee.Core.Schema.XsdDateTime {
        
        public SimpleDateTime(System.DateTime value) : 
                base(value) {
            this.SuuremVordneKui = Parse("2009-01-01T00:00:00");
            this.Validate();
        }
        
        public SimpleDateTime(string value) : 
                base(value) {
            this.SuuremVordneKui = Parse("2009-01-01T00:00:00");
            this.Validate();
        }
        
        public SimpleDateTime() : 
                base(new System.DateTime()) {
        }
        
        public static bool TryParse(string value, out global::Kis.Xroad.Eu.SimpleDateTime result) {
            try {
                result = new global::Kis.Xroad.Eu.SimpleDateTime(value);
                return true;
            }
            catch (System.Exception ) {
                result = null;
                return false;
            }
        }
        
        public static implicit operator DateTime (SimpleDateTime value) {
            return value.Value;
        }
        
        public static implicit operator SimpleDateTime (System.DateTime value) {
            return new SimpleDateTime(value);
        }
    }
}
